package org.shopping.service.commodity;

import org.shopping.domain.Commodity;
import org.shopping.domain.PageBean;

import java.util.List;

public interface CommodityService {

    /**
     * 所有商品
     * @return
     */
    List<Commodity> selectAll();

    /**
     * 封装每页的分页数据到PageBean
     * @param currentPage
     * @param pageSize
     * @return
     */
    PageBean<Commodity> findPageByCurrentPage(Integer currentPage, Integer pageSize);

    /**
     * 删除指定商品
     * @param cidForm
     * @return
     */
    boolean deleteCommodity(String cidForm);

    /**
     * 找到要修改的商品
     * @param cidForm
     * @return
     */
    Commodity findOneCommodity(String cidForm);

    /**
     * 修改商品后更新数据
     * @param commodity
     * @param updateCid
     * @return
     */
    boolean updateCommodity(Commodity commodity, String updateCid);

    /**
     * 添加商品
     * @param commodity
     * @return
     */
    boolean addCommodity(Commodity commodity);

}
